/*
 * @Author: sunzhijun 
 * @Date: 2020-02-28 21:39:24 
 * @Last Modified by:   sunzhijun 
 * @Last Modified time: 2020-02-28 21:39:24 
 */

import { render } from 'src/hrpub/common/frame';
import Pagination from 'src/hrpub/common/components/Pagination';
import PaginationAction from '../../actions/pagination';
import TableAction from '../../actions/table';
import './index.less';

const PaginationArea = render({
    actions: {
        paginationAct: PaginationAction,
        tableAct: TableAction
    }
})(({ props, action, state }) => {
    const { main, editTable } = props;
    let { pageInfo, isVisiblePagination } = main; 
    return (
        !!isVisiblePagination ?
        <div className="pagination">
            <Pagination
                // current = {pageInfo.pageIndex}
                // hideOnSinglePage = {true}
                {...props}
                showSizeChanger = {true}
                current = {pageInfo.pageIndex * 1}
                pageSize = {pageInfo.pageSize}
                showQuickJumper = {true}
                total = {pageInfo.total}
                onChange= {action.paginationAct.changePaginationFn}
                onShowSizeChange = {action.paginationAct.pageSizeSelect}
            />
        </div> : null
    );
});
export default PaginationArea;